<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pretty="http://ocpsoft.com/prettyfaces"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="../templates/mainTemplate.xhtml">
	<ui:define name="ajaxStatus">
	</ui:define>

	<ui:define name="content">
		<div class="box">
			<h2>
				<a id="toggle-user-list" href="#"><h:outputText
						value="#{msg['userlist.list']}" /></a>
			</h2>
			<div id="user-list" class="block tables">
				<p:ajaxStatus style="width:16px;height:16px;">
					<f:facet name="start">
						<p:graphicImage value="#{resource['img:ajaxloading.gif']}" />
					</f:facet>

					<f:facet name="complete">
						<h:outputText value="" /> 
					</f:facet>
				</p:ajaxStatus>

				<h:form prependId="false">
					<p:messages showDetail="true" showSummary="false" />

					<p:dataTable var="user" widgetVar="userTable" rowIndexVar="index"
						value="#{userListBean.userList}" paginator="true" rows="10"
						paginatorPosition="top"
						emptyMessage="#{msg['prime.noRecordsFound']}"
						rowStyleClass="#{index % 2 == 0 ? 'odd' : 'even'}">
						<f:facet name="header">
							<p:outputPanel>
								<h:outputText value="#{msg['userlist.searchInEveryColumn']}" />
								<p:inputText id="globalFilter" onkeyup="userTable.filter()" />
							</p:outputPanel>
						</f:facet>
						<p:columnGroup type="header">
							<p:row>
								<p:column headerText="ID" sortBy="#{user.userid}" />
								<p:column headerText="#{msg['userlist.login']}"
									sortBy="#{user.login}" filterBy="#{user.login}"
									filterMatchMode="contains" filterStyle="display: none;" />
								<p:column headerText="#{msg['userlist.lastLogin']}"
									sortBy="#{user.lastLogin}" />
								<p:column headerText="#{msg['userlist.created']}"
									sortBy="#{user.createDate}" />
								<p:column headerText="#{msg['userlist.flags']}"
									sortBy="#{user.flags}" filterBy="#{user.flags}"
									filterMatchMode="contains" filterStyle="display: none;" />
								<p:column headerText="#{msg['userlist.options']}" />
							</p:row>
						</p:columnGroup>

						<p:column>
							<h:outputText value="#{user.userid}" />
						</p:column>

						<p:column>
							<h:outputText value="#{user.login}" />
						</p:column>

						<p:column>
							<h:outputText value="#{user.lastLogin}" />
						</p:column>

						<p:column>
							<h:outputText value="#{user.createDate}" />
						</p:column>

						<p:column>
							<h:outputText value="#{user.flags}" />
						</p:column>

						<p:column>
							<p:commandButton ajax="false" action="pretty:userDetails"
								image="ui-icon ui-icon-pencil" title="#{msg['userlist.edit']}">
								<f:setPropertyActionListener target="#{userDetailsBean.id}"
									value="#{user.userid}" />
							</p:commandButton>
						</p:column>
					</p:dataTable>
				</h:form>
			</div>
		</div>
	</ui:define>
</ui:composition>

</html>
